﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using EzDesk.Core.ServiceImpl.Services;
using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;

namespace EzDesk.Core.UnitTest
{
    [TestFixture]
    public class FeedTypeDictionaryFixture
    {
        [Test]
        public void TestMethod1()
        {
            var allTypes = FeedTypeDictionary.AllFeedTypes();
            Assert.AreEqual(allTypes.Count, 3);

            var i1 = FeedTypeDictionary.StringToIntType("todo");
            var i2 = FeedTypeDictionary.StringToIntType("notification");
            var i3 = FeedTypeDictionary.StringToIntType("update");
            var i4 = FeedTypeDictionary.StringToIntType("error");
            Assert.AreEqual(i1, 2);
            Assert.AreEqual(i2, 1);
            Assert.AreEqual(i3, 0);
            Assert.AreEqual(i4, -1);

            var s1 = FeedTypeDictionary.IntTypeToString(0);
            var s2 = FeedTypeDictionary.IntTypeToString(1);
            var s3 = FeedTypeDictionary.IntTypeToString(2);
            var s4 = FeedTypeDictionary.IntTypeToString(3);
            Assert.AreEqual(s1, "update");
            Assert.AreEqual(s2, "notification");
            Assert.AreEqual(s3, "todo");
            Assert.AreEqual(s4, null);
        }
    }
}

